package study.javabasic.Thread;


public class CyclicWait implements Runnable {

    private String name;

    @Override
    public void run() {

        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        name = "name======name";

    }

    public static void main(String[] args) throws InterruptedException {
        CyclicWait cyclicWait = new CyclicWait();
        Thread thread = new Thread(cyclicWait);
        thread.start();
        /*while (null == cyclicWait.name) {
            Thread.currentThread().sleep(100);

        }*/
        thread.join();
        System.out.println(cyclicWait.name);
    }
}
